php forum
php mysql forum
php mysql smarty
 
Topic Options
#276873 - 07/17/04 06:49 PM Finished-[6.3] Prevent avatar pics from stretching to the max allowable size
Twisty Offline
Code Monkey

Registered: 09/26/03
Posts: 524
Mod Name / Version: Prevent avatar pics from stretching to the max allowable size after editing personal prefs (editbasic.php). <br /> <br />Description: This is a bug-fix which prevents avatar pics from *stretching to the maximum allowable image size after a user makes changes to their personal prefs page, but where they don't upload a new avatar. <br /> <br />*In order for the stretch to occur, their avatar pic must have been originally smaller (width and/or height) than the max allowable size. If it was already larger (both width & height), then no stretching would have occured since it gets set to the maximum size anyway. <br /> <br /> <br /> <br />Working Under: UBB.Threads 6.3 <br /> <br />Mod Status: Finished <br /> <br />Any pre-requisites: <br /> <br />Author(s): Twisty <br /> <br />Date: 07/17/04 <br /> <br />Credits: <br /> <br />Files Altered: changebasic.php <br /> <br />New Files: <br /> <br />Database Altered: no <br /> <br />Info/Instructions: In changebasic.php... <br /> <br />CHANGE THIS: <br /> <br />
Code:
// ---------------------------------------------------------- <br />// If picture doesn't end with gif or jpg then we disallow it <br />   if ( ($Picture) &amp;&amp; ($Picture != "http://") &amp;&amp; (!preg_match("/(png|jpg|gif)$/i",$Picture))) { <br />      $html -&gt; not_right($ubbt_lang['BAD_PIC'],$Cat); <br />   } <br />   if ( ($Picture != $OldPicture) &amp;&amp; ($Picture) &amp;&amp; ($Picture != "http://") &amp;&amp; ($Picture != "none") ) {
<br /> <br />TO THIS: <br /> <br />
Code:
// ---------------------------------------------------------- <br />// If picture doesn't end with gif or jpg then we disallow it <br />   if ( ($Picture) &amp;&amp; ($Picture != "http://") &amp;&amp; (!preg_match("/(png|jpg|gif)$/i",$Picture))) { <br />      $html -&gt; not_right($ubbt_lang['BAD_PIC'],$Cat); <br />   } <br />   if ( ( ($Picture) || ($OldPicture) ) &amp;&amp; ($Picture != "http://") &amp;&amp; ($Picture != "none") ) {
<br /> <br /> <br />:-) <br /> <br /> <br />Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /> <br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.

Top
#276874 - 07/18/04 07:42 AM Re: Finished-[6.3] Prevent avatar pics from stretching to the max allowable size [Re: smoknz28]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
Nice one, thanks. This has been bugging me for quite a while, but not enough to actually do anything about it. =]
_________________________
/Gardener | Complete list of my mods

Top
#276875 - 07/18/04 01:31 PM Re: Finished-[6.3] Prevent avatar pics from stretching to the max allowable size [Re: c0bra]
Twisty Offline
Code Monkey

Registered: 09/26/03
Posts: 524
My visitors were getting ready to inflict grievous bodily harm on me if I didn't finally fix this one, so I pretty much did it for self-preservation reasons <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
Twisty []http://www.mameworld.info/misc/nana2.gif[/]
MAMEWorld

Top
#276876 - 07/18/04 02:43 PM Re: Finished-[6.3] Prevent avatar pics from stretching to the max allowable size [Re: smoknz28]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
Luckily my users haven't really found out when and why it happens yet and I'm not going to say anything. =]
_________________________
/Gardener | Complete list of my mods

Top
#276877 - 07/21/04 04:33 PM Re: Finished-[6.3] Prevent avatar pics from stretching to the max allowable [Re: c0bra]
J.C. Offline
Addict

Registered: 08/11/00
Posts: 1551
FYI This is not correct in 6.5 b4.<br /><br />The code in b4 is:<br /><br />// ----------------------------------------------------------<br />// If picture doesn't end with gif or jpg then we disallow it<br />if ( ($Picture) && ($Picture != "http://") && (!preg_match("/(png|jpg|gif)$/i",$Picture))) {<br /> $html -> not_right($ubbt_lang['BAD_PIC'],$Cat);<br />}<br />if ($picchange == "url") {<br /> if ( ($Picture) && ($Picture != "http://") && ($Picture != "none") ) {
_________________________
- Custom Web Development
http://www.JCSWebDev.com

Top
#276878 - 07/21/04 05:16 PM Re: Finished-[6.3] Prevent avatar pics from stretching to the max allowable [Re: chrisX]
Twisty Offline
Code Monkey

Registered: 09/26/03
Posts: 524
[]J.C. said: <br />FYI This is not correct in 6.5 b4. <br /> <br />The code in b4 is: <br /> <br />// ---------------------------------------------------------- <br />// If picture doesn't end with gif or jpg then we disallow it <br />if ( ($Picture) && ($Picture != "http://") && (!preg_match("/(png|jpg|gif)$/i",$Picture))) { <br /> $html -> not_right($ubbt_lang['BAD_PIC'],$Cat); <br />} <br />if ($picchange == "url") { <br /> if ( ($Picture) && ($Picture != "http://") && ($Picture != "none") ) { [/] <br /> <br />Yes, it has been fixed sometime since v6.3 because the problem no longer occurs on this board. But it was still there for v6.3 users, and the mod is not meant to be used by anyone using a newer version.
_________________________
Twisty []http://www.mameworld.info/misc/nana2.gif[/]
MAMEWorld

Top



Moderator:  Ian_W 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks